package com.whut.monitor.dao;

import java.io.Serializable;
import java.util.List;
import java.util.Map;

/**
 * @author qing
 * MySQL数据库DAO层封装
 */
public interface IBaseDao<T> {
    void save(T o);

    void delete(T o);

    void update(T o);

    void saveOrUpdate(T o);

    T findOne(Class<T> c, Serializable id);

    T findOne(String hql);

    T findOne(String hql, Map<String, Object> params);

    List<T> findList(String hql);

    List<T> findList(String hql, Map<String, Object> params);

    List<T> findList(String hql, int page, int rows);

    List<T> findList(String hql, Map<String, Object> params, int page, int rows);

    Long count(String hql);

    Long count(String hql, Map<String, Object> params);

    int executeHql(String hql);

    int executeHql(String hql, Map<String, Object> params);

    void bathSave(List<T> list);
}
